-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(nuxt): Instrument storage API #17858
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
feat(nuxt): Instrument storage API #17858
Conversation
07cb542
to
24a5470
Compare
a6dc41f
to
fe203a5
Compare
}, | ||
}); | ||
|
||
addServerPlugin(moduleDirResolver.resolve('./runtime/plugins/storage.server')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Incorrect Plugin Path in Storage Configuration
The addServerPlugin
call in storageConfig.ts
uses an incorrect relative path to the storage server plugin. Since storageConfig.ts
is located in the vite
directory, ./runtime/plugins/storage.server
resolves to the wrong location, preventing the plugin from being found.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a problem, the path isn't relative to current file, but to the module itself.
What
This PR adds automatic instrumentation for Nuxt's storage layer (powered by unstorage), enabling performance monitoring for cache and key-value storage operations in Nuxt/Nitro applications.
Storage operations will now automatically create performance spans with detailed attributes for observability in Sentry.
What's New
nuxt.config.ts
vianitro.storage
getItem
,setItem
,hasItem
,removeItem
getItemRaw
,setItemRaw
getItems
,setItems
getKeys
,clear
get
,set
,has
,del
,remove
Implementation Details
Span Attributes:
sentry.op
:cache.{operation}
(e.g.,cache.get_item
,cache.set_item
)sentry.origin
:auto.cache.nuxt
cache.key
: Full key including mount prefixcache.hit
:true
for successful get/has operationsnuxt.storage.op
: Original method namenuxt.storage.mount
: Storage mount pointnuxt.storage.driver
: Driver name (e.g.,memory
,fs
,redis
)Files Changed:
packages/nuxt/src/runtime/plugins/storage.server.ts
- Runtime instrumentation pluginpackages/nuxt/src/vite/storageConfig.ts
- Build-time configurationpackages/nuxt/src/module.ts
- Module integration